package tony.core.model;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import org.jspecify.annotations.NonNull;

import java.util.Collection;

/**
 * 列表请求
 *
 * @author tangli
 * @date 2025/09/10 00:00
 */
public record RowsReq<T>(
    Collection<@Valid T> rows
){
    /**
     * 返回包装集合对象.
     *
     * @return 集合对象
     */
    @Schema(description = "列表")
    @JsonSetter(nulls = Nulls.AS_EMPTY, contentNulls = Nulls.AS_EMPTY)
    @NonNull
    public Collection<@Valid T> getRows() {
        return rows;
    }
}
